import type { RouteRecordRaw } from 'vue-router';
export interface Meat {
  transition?: string;
  menuName?: string;
}
export type RouteRecordRawNew = Omit<RouteRecordRaw, 'component' | 'children'> & { component: any } & {
  children?: RouteRecordRawNew[] | any;
} & { meta: Meat };
export const routesList: RouteRecordRawNew[] = [
  {
    path: '/applicationManagement',
    name: 'applicationManagement',
    component: 'applicationManagement/index.vue',
    meta: {
      transition: 'slide-right',
      menuName: '应用管理',
      icon: 'app-mng-icon',
      // keepAlive: true,
    },
  },
  {
    path: '/artifactRepository',
    name: 'artifactRepository',
    component: 'artifactRepository/index.vue',
    meta: {
      transition: 'slide-right',
      menuName: '制品仓库',
      icon: 'artifact-icon',
    },
  },
  {
    path: '/operationManagement',
    name: 'operationManagement',
    component: 'operationManagement/index.vue',
    meta: {
      transition: 'slide-right',
      menuName: '运维',
      icon: 'operation-icon',
    },
  },
  {
    path: '/myPipeline',
    name: 'myPipeline',
    component: 'myPipeline/myLine/index.vue',
    meta: {
      transition: 'slide-right',
      menuName: '我的流水线',
      icon: 'mypipeline-icon',
    },
  },
  {
    path: '/projectManagement',
    name: 'projectManagement',
    component: 'projectManagement/index.vue',
    meta: {
      transition: 'slide-right',
      menuName: '项目管理',
      icon: 'project-mng-icon',
    },
  },
];

export const publicRoutes = [
  {
    // 404页面配置
    path: '/:catchAll(.*)',
    component: () => import('@/views/notPage/index.vue'),
    meta: {
      transition: 'slide-right',
      menuName: '404',
    },
  },
];

export const hiddenRoutes = [
  {
    path: '/pipelineConfig/:code',
    name: 'pipelineConfig',
    component: 'myPipeline/edit/index.vue',
    meta: {
      hidden: true,
      transition: 'slide-right',
      menuName: '编辑流水线',
    },
  },
  {
    path: '/pipelineDetail/:type/:code',
    name: 'pipelineDetail',
    component: 'myPipeline/edit/index.vue',
    meta: {
      hidden: true,
      transition: 'slide-right',
      menuName: '流水线编辑态详情',
    },
  },
  {
    path: '/pipelineTemplate/:type/:code?',
    name: 'pipelineTemplate',
    component: 'operationManagement/assemblyLineTemplate/pipelineTemplate.vue',
    meta: {
      hidden: true,
      transition: 'slide-right',
      menuName: '编辑流水线模板',
    },
  },
  {
    path: '/pipelineRunning/:code/:tabName?',
    name: 'pipelineRunning',
    component: 'myPipeline/running/index.vue',
    meta: {
      hidden: true,
      transition: 'slide-right',
      menuName: '运行详情',
    },
  },
  {
    path: '/artifactRepository/artifactManage/:repository/:code',
    name: 'artifactManage',
    component: 'artifactRepository/manage/index.vue',
    meta: {
      hidden: true,
      transition: 'slide-right',
      menuName: '制品管理',
    },
  },
];
